﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ZYing.QPanel
{
    public class HttpQuartzApiService : IQuartzApiService
    {
        public HttpQuartzApiService(QPanelEnvironment environment) => Environment = environment ?? throw new ArgumentNullException(nameof(environment));
        public QPanelEnvironment Environment { get; }
        public object Now() => new
        {
            Time = DateTime.Now,
            Timestamp = DateTimeOffset.Now.ToUnixTimeSeconds()
        };

        public async Task<Quartz.SchedulerMetaData> GetMetaData()
        {
            return await this.Environment.Scheduler.GetMetaData();
        }
    }
}
